<?php

namespace Bean\Flow\RssFlow;

class User extends \Bean\User {

	private $_node;
	private $_fullName;
	private $_url;
	private $_image;
	
	public function __construct( \DOMNode $node ) {
		parent::__construct( array() );
		$this->_node = $node;
		
		foreach( $node->childNodes as $child ) {
			if( !$child instanceof \DOMNode ) {
				continue;
			}
			switch( mb_strtolower( $child->tagName ) ) {
				case 'url':
					$this->_image = trim($child->nodeValue);
					break;
				case 'title':
					$this->_fullName = trim($child->nodeValue);
					break;
				case 'link':
					$this->_url = trim($child->nodeValue);
					break;
			}
		}
	}
	
	public function getUserId() {
		return $this->getUrl();
	}
	
	public function getFullName() {
		return $this->_fullName;
	}
	
	public function getUrl() {
		return $this->_url;
	}
	
	public function getThumbPath() {
		return $this->_image;
	}
}
